﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TestCrawler.Http;

namespace TestCrawler
{
    class Program
    {
        static void Main(string[] args)
        {
            Crawler c = new Crawler("http://public.ucn.dk/fen/testsite/");

            Console.WriteLine("*** Downloading pages and Building Sitemap ***\n");
            c.BuildSiteMap();
            Console.WriteLine("\n\n*** Traversing Sitemap ***\n");
            c.GraphTraversal();

            //SocketTest("http://public.ucn.dk/fen/testsite/");
            //TcpTest("http://public.ucn.dk/fen/testsite/");

            Console.ReadLine();
        }

        static void SocketTest(string url)
        {
            HttpSocket socket = new HttpSocket();
            string page = socket.Receive(url);
            Console.WriteLine(page);
        }

        static void TcpTest(string url)
        {
            HttpTcpClient client = new HttpTcpClient();
            string page = client.Receive(url);
            Console.WriteLine(page);
        }
    }
}
